

var app = new Vue({
    el:'#app',
    data:{
        sceatr:'hello',
    },
    mounted(){
        axios
            .get("json/news.json")
            .then(response => this.sceatr = response.data.urls)
            .catch(function (error) {
                console.log(error);
            })
    },


});


/*小三角*/
var arrow = document.querySelector(".arrow");
arrow.addEventListener("click",function(){
    window.scrollTo({
        top: 701,
        behavior:'smooth'/*匀速*/

    })
});




/*搜索框*/
var body = document.querySelector( "body");
var wan = document.querySelector(".search .in");
var wen = document.querySelector(".dh");
var head = document.querySelector(".head-search-close");
var bei = document.querySelector(".header-bei");
var box = document.querySelector("#box");



head.onclick = function(){
    wen.style.display = "none";
    bei.style.display = "none";

};
wan.addEventListener("click",function(){
    wen.style.display = "block";
    bei.style.display = "block";
});


var bt_1 = document.querySelector(".header .q1");
var bt_3 = document.querySelector(".header-bei .q1");

var bt_2 = document.querySelector(".sw-1");
bt_1.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_2.style.display = "block";
    bei.style.display = "block";
});
bt_1.addEventListener("mouseleave", function () {
    box.style.display="none";
    bt_2.style.display = "none";
    bei.style.display = "none";
});
bt_3.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_2.style.display = "block";
    bei.style.display = "block";
});
bt_3.addEventListener("mouseleave", function () {
    box.style.display="none";
    bt_2.style.display = "none";
    bei.style.display = "none";
});
bt_2.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_2.style.display = "block";
    bei.style.display = "block";
});
bt_2.addEventListener("mouseleave", function () {
    box.style.display="none";
    bt_2.style.display = "none";
    bei.style.display = "none";
});


//
var bt_4 = document.querySelector(".header .q2");
var bt_5 = document.querySelector(".header-bei .q2");
var bt_6 = document.querySelector(".sw-2");
bt_4.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_6.style.display = "block";
    bei.style.display = "block";
});
bt_4.addEventListener("mouseleave", function () {
    box.style.display="none";
    bt_6.style.display = "none";
    bei.style.display = "none";
});
bt_5.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_6.style.display = "block";
    bei.style.display = "block";
});
bt_5.addEventListener("mouseleave", function () {
    box.style.display="none";
    bt_6.style.display = "none";
    bei.style.display = "none";
});
bt_6.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_6.style.display = "block";
    bei.style.display = "block";
});
bt_6.addEventListener("mouseleave", function () {
    box.style.display="none";
    bt_6.style.display = "none";
    bei.style.display = "none";
});
//
var bt_7 = document.querySelector(".header .q3");
var bt_8 = document.querySelector(".header-bei .q3");
var bt_9 = document.querySelector(".sw-3");
bt_7.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_9.style.display = "block";
    bei.style.display = "block";
});
bt_7.addEventListener("mouseleave", function () {
    box.style.display="none";
    bt_9.style.display = "none";
    bei.style.display = "none";
});
bt_8.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_9.style.display = "block";
    bei.style.display = "block";
});
bt_8.addEventListener("mouseleave", function () {
    box.style.display="none";
    bt_9.style.display = "none";
    bei.style.display = "none";
});
bt_9.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_9.style.display = "block";
    bei.style.display = "block";
});
bt_9.addEventListener("mouseleave", function () {
    box.style.display="none";
    bt_9.style.display = "none";
    bei.style.display = "none";
});
//
var bt_10 = document.querySelector(".header .q4");
var bt_11 = document.querySelector(".header-bei .q4");
var bt_12 = document.querySelector(".sw-4");
bt_10.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_12.style.display = "block";
    bei.style.display = "block";
});
bt_10.addEventListener("mouseleave", function () {
    bt_12.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
bt_11.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_12.style.display = "block";
    bei.style.display = "block";
});
bt_11.addEventListener("mouseleave", function () {
    bt_12.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
bt_12.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_12.style.display = "block";
    bei.style.display = "block";
});
bt_12.addEventListener("mouseleave", function () {
    bt_12.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
//
var bt_13 = document.querySelector(".header .q5");
var bt_14 = document.querySelector(".header-bei .q5");
var bt_15 = document.querySelector(".sw-5");
bt_13.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_15.style.display = "block";
    bei.style.display = "block";
});
bt_13.addEventListener("mouseleave", function () {
    bt_15.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
bt_14.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_15.style.display = "block";
    bei.style.display = "block";
});
bt_14.addEventListener("mouseleave", function () {
    bt_15.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
bt_15.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_15.style.display = "block";
    bei.style.display = "block";
});
bt_15.addEventListener("mouseleave", function () {
    bt_15.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
//
var bt_16 = document.querySelector(".header .q6");
var bt_17 = document.querySelector(".header-bei .q6");
var bt_18 = document.querySelector(".sw-6");
bt_16.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_18.style.display = "block";
    bei.style.display = "block";
});
bt_16.addEventListener("mouseleave", function () {
    bt_18.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
bt_17.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_18.style.display = "block";
    bei.style.display = "block";
});
bt_17.addEventListener("mouseleave", function () {
    bt_18.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
bt_18.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_18.style.display = "block";
    bei.style.display = "block";
});
bt_18.addEventListener("mouseleave", function () {
    bt_18.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
//
var bt_19 = document.querySelector(".header .q7");
var bt_20 = document.querySelector(".header-bei .q7");
var bt_21 = document.querySelector(".sw-7");
bt_19.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_21.style.display = "block";
    bei.style.display = "block";
});
bt_19.addEventListener("mouseleave", function () {
    bt_21.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
bt_20.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_21.style.display = "block";
    bei.style.display = "block";
});
bt_20.addEventListener("mouseleave", function () {
    bt_21.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
bt_21.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_21.style.display = "block";
    bei.style.display = "block";
});
bt_21.addEventListener("mouseleave", function () {
    bt_21.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
//
var bt_22 = document.querySelector(".header .q8");
var bt_23 = document.querySelector(".header-bei .q8");
var bt_24 = document.querySelector(".sw-8");
bt_22.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_24.style.display = "block";
    bei.style.display = "block";
});
bt_22.addEventListener("mouseleave", function () {
    bt_24.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
bt_23.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_24.style.display = "block";
    bei.style.display = "block";
});
bt_23.addEventListener("mouseleave", function () {
    bt_24.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});
bt_24.addEventListener("mouseover", function () {
    box.style.display="block";
    bt_24.style.display = "block";
    bei.style.display = "block";
});
bt_24.addEventListener("mouseleave", function () {
    bt_24.style.display = "none";
    bei.style.display = "none";
    box.style.display="none";
});

/*选项卡部分*/
var tab = document.querySelectorAll("#tab li");
var sop = document.querySelectorAll(".sop div");
for (var i = 0; i < tab.length; i++) {
    tab[i].onclick = showlist;
}
function showlist() {
    console.log(this.bool);
    for (var i = 0; i < tab.length; i++) {
        if (tab[i] === this) {
            tab[i].className = "active";
            sop[i].className = "list";
        } else {
            tab[i].className = "";
            sop[i].className = "";
        }
    }
}
/*钻石品类部分动画效果*/


if(document.documentElement.clientWidth > 600){
/*侧边导航条*/
var w_left = document.querySelector(".w-left");
var list = document.querySelectorAll(".list ul li");
window.onscroll = function () {
    if (document.documentElement.scrollTop > 700){
        w_left.style.display = "block";
    }else{
        w_left.style.display = "none";
    }
};
}


var ku_1 = document.querySelector("#ku-1");
var ku_2 = document.querySelector("#ku-2");
var ku_3 = document.querySelector("#ku-3");
var ku_4 = document.querySelector("#ku-4");
var ku_5 = document.querySelector("#ku-5");
var ku_6 = document.querySelector("#ku-6");
ku_1.addEventListener('click',function(){
    window.scrollTo({
        top: 680,
        behavior:'smooth'
    })
});
ku_2.addEventListener('click',function(){
    window.scrollTo({
        top: 1200,
        behavior:'smooth'
    })
});
ku_3.addEventListener('click',function(){
    window.scrollTo({
        top: 1750,
        behavior:'smooth'
    })
});
ku_4.addEventListener('click',function(){
    window.scrollTo({
        top: 2400,
        behavior:'smooth'
    })
});
ku_5.addEventListener('click',function(){
    window.scrollTo({
        top: 3000,
        behavior:'smooth'
    })
});
ku_6.addEventListener('click',function(){
    window.scrollTo({
        top: 0,
        behavior:'smooth'
    })
});



/*底部友情链接划过效果*/
var stit = document.querySelector(".stit");
var sub_box = document.querySelector(".sub-box");
stit.addEventListener("mouseover", function () {
    sub_box.style.height = "133px";
});
stit.addEventListener("mouseleave", function () {
    sub_box.style.height = "0";
});
sub_box.addEventListener("mouseover", function () {
    sub_box.style.height = "133px";
});
sub_box.addEventListener("mouseleave", function () {
    sub_box.style.height = "0";
});


